﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace PCC
{
    public class Utility
    {
        public static IEnumerable<T> GetAllTypes<T>()
        {
            var type = typeof(T);
            return AppDomain.CurrentDomain.GetAssemblies().ToList()
                       .SelectMany(s => s.GetTypes())
                       .Where(type.IsAssignableFrom) as IEnumerable<T>;
        }
    }
}